<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
	<head>
		<title>添加违章记录</title>
		<meta http-equiv="pragma" content="no-cache">
	    <meta http-equiv="cache-control" content="no-cache">
	    <meta http-equiv="expires" content="0">    
    
		<link href="/SCMDB/style/SuperEdit.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="/SCMDB/js/Super.js"></script>
		<script type="text/javascript" src="/SCMDB/js/DatePicker/WdatePicker.js"></script>
		<script type="text/javascript" src="/SCMDB/js/jquery-1.4.2.js"></script>
		
	</head>
	<body>
		<div class="main">
			<s:form action="violationRecordAction!addViolationRecord" theme="simple" method="post"
				onsubmit="return false;" enctype="multipart/form-data">
				<!-- 主体开始 -->
				<table border="0" cellpadding="1" cellspacing="1" class="tableModify">
					<!-- <tr>
						<th>标题：</th>
						<td>
							<s:textfield name="title" cssClass="sInput" title='标题' cssStyle="width:250px;" />
							<input type="hidden" value="must-input"/>
						</td>
					</tr>
					 -->
					 <!--
					<tr>
						<th>原由：</th>
						<td>
							<s:textarea name="content" id="content" cssClass="sInput" title="原由" cssStyle="width:250px;height:100px;"></s:textarea>
							<input type="hidden" value="must-input"/>
						</td>
					</tr>
					-->
					<tr>
						<th>违章程度：</th>
						<td>
							<div class="right">
								<s:radio onclick="selectGrade(this)" list="#{'一般':'一般', '较大':'较大', '重大':'重大'}"  name="grade" title="违章程度"></s:radio>
							</div>
						</td>
					</tr>
					<tr>
						<th>违章类型：</th>
						<td>
							<div id="illegalTypeDiv" class="right">
								请选择违章制度
							</div>
							
							<s:hidden name="illegalTypeId" id="illegalTypeId"></s:hidden>
							<input type="hidden" value="must-input"/>
						</td>
					</tr>
					<tr>
						<th>违章人：</th>
						<td>
							<s:textfield readonly="true" name="empName" id="empName" cssClass="sInput" title='违章人' />
							<span style="cursor:pointer" onclick="selectEmployee();">选择人员</span>
							
							<input type="hidden" value="must-input"/>
							
							<s:hidden name="empId" id="empId"></s:hidden>
						</td>
					</tr>
					<tr>
						<th>违章日期：</th>
						<td>
							<s:textfield cssClass="timeInput" id="violationDate" name="violationDate" readonly="true" onclick="WdatePicker()" title="违章日期" />
							<input type="hidden" value="must-input" />
						</td>
					</tr>
					<tr>
						<th>处理情况：</th>
						<td>
							<div class="right">
								<s:radio list="#{false:'未处理', true:'已处理'}" name="rectification" title="处理情况"></s:radio>
							</div>
						</td>
					</tr>
					<tr>
						<th>备注：</th>
						<td>
							<s:textarea name="description" id="description" cssClass="sInput" title="原由" cssStyle="width:250px;height:100px;"></s:textarea>
							<input type="hidden" value="must-input"/>
						</td>
					</tr>
					<tr>
						<th>附件：</th>
						<td><s:file name="image" cssStyle="width:223px;" /></td>
					</tr>
				</table>
			</s:form>
		</div>
	</body>
	
	<script type="text/javascript">
		function selectEmployee() {
			var settings = 'help:no;scroll:auto;status:no;dialogWidth:'+900 +'px;dialogHeight:'+580+'px';
			var result = window.showModalDialog("/SCMDB/emp/selectOM.jsp", null,settings);
			if(result.id.indexOf(",") > 0) {
				alert("只能选择一个人员!");
				return;
			}
			document.getElementById("empId").value = result.id;
			document.getElementById("empName").value = result.name;
		}
	</script>
	
	<script type="text/javascript">
			function selectGrade(obj) {
				var str = "";
				switch(obj.value) {
					case "一般":
						str += "<input type=\"checkbox\" name=\"illegalTypeIds\" value=1 />作业人员劳动防护用品未按要求佩戴<br />";
						str += "<input type=\"checkbox\" name=\"illegalTypeIds\" value=2 />作业人员未经过安全教育培训上岗<br />";
						str += "<input type=\"checkbox\" name=\"illegalTypeIds\" value=3 />作业人员未正确使用工具、设施<br />";
						str += "<input type=\"checkbox\" name=\"illegalTypeIds\" value=4 />作业人员不遵守现场规章制度";
					//illegalTypeDiv
					break;
					case "较大":
						str += "<input type=\"checkbox\" name=\"illegalTypeIds\" value=5 />施工机械设备未按规定检测或验收就已使用的<br />";
						str += "<input type=\"checkbox\" name=\"illegalTypeIds\" value=6 />起重吊装违反‘十不吊’规定的<br />";
						str += "<input type=\"checkbox\" name=\"illegalTypeIds\" value=7 />临时施工用电违反用电规范的<br />";
						str += "<input type=\"checkbox\" name=\"illegalTypeIds\" value=8 />特殊工种作业人员无证操作的<br />";
						str += "<input type=\"checkbox\" name=\"illegalTypeIds\" value=9 />宿舍内电线乱拖乱拉、违规使用电器的<br />";
						str += "<input type=\"checkbox\" name=\"illegalTypeIds\" value=10 />施工现场动火不符合消防安全管理规定的";
					break;
					
					case "重大":
						str += "<input type=\"checkbox\" name=\"illegalTypeIds\" value=11 />未按安全技术专项方案进行施工的<br />";
						str += "<input type=\"checkbox\" name=\"illegalTypeIds\" value=12 />无方案擅自施工的<br />";
						str += "<input type=\"checkbox\" name=\"illegalTypeIds\" value=13 />安全防护设施存在较大安全隐患或无安全防护设施进行作业的<br />";
						str += "<input type=\"checkbox\" name=\"illegalTypeIds\" value=14 />脚手架、模板支撑、大型设备、临时用电等设施未经验收合格后使用的";
					break;
				}
				$("#illegalTypeDiv").html(str);
				//document.getElementById("illegalTypeDiv").innerHTML = str;
			}
	</script>
	
</html>


